package com.sc.nft.entity.req;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author 刘国航
 * @desc
 * @since 2024/11/27 10:35
 */
@Data
public class DaoPledgeUpdateRequest implements Serializable {

    private static final long serialVersionUID = -5355725895645686801L;

    @ApiModelProperty("id")
    @NotNull(message = "id不能为空")
    private Long id;

    @ApiModelProperty("品牌id")
    @NotNull(message = "品牌id不能为空")
    private Long daoId;

    @ApiModelProperty("活动名称")
    @NotEmpty(message = "活动名称不能为空")
    private String name;

    @ApiModelProperty("活动封面")
    @NotEmpty(message = "活动封面不能为空")
    private String coverPicture;

    @ApiModelProperty("活动主图")
    @NotEmpty(message = "活动主图不能为空")
    private String masterPicture;

    @ApiModelProperty("开始时间")
    @NotNull(message = "开始时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @ApiModelProperty("活动规则")
    @NotEmpty(message = "活动规则不能为空")
    private String activeRule;

    @ApiModelProperty("藏品id列表")
    @NotNull(message = "藏品id列表不能为空")
    private List<Long> collectionIdList;

    @ApiModelProperty("发行期列表")
    @NotNull(message = "发行期列表不能为空")
    private List<DaoPledgePeriodsCreateRequest> periodsList;

    @ApiModelProperty("产出列表")
    @NotNull(message = "产出列表不能为空")
    private List<DaoPledgeProduceCreateRequest> produceList;

    @ApiModelProperty("直推比例")
    @NotNull(message = "直推比例不能为空")
    @Min(value = 0, message = "直推比例不能小于0")
    @Max(value = 1, message = "直推比例不能大于100%")
    private BigDecimal pushRatio;

    @ApiModelProperty("是否消耗共识度")
    @NotNull(message = "是否消耗共识度不能为空")
    private Boolean consumeConsensus;

}
